package control;

import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import model.happy.HappyTimeService;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.multiaction.MultiActionController;


public class HappyTimeController extends MultiActionController{
	private HappyTimeService happyTimeService;
	
	public HappyTimeController(HappyTimeService happyTimeService) {
		super();
		this.happyTimeService = happyTimeService;
	}
	
	public ModelAndView happyTime(HttpServletRequest request,HttpServletResponse response){
		List<HashMap> list=null;
		try {
			list = happyTimeService.happytime();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return new ModelAndView("happy_time_result.happy","result",list);
	}
}
